﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/MySite.master" Title="Dislocation" CodeBehind="MainForm.aspx.cs" Inherits="DigDes.DSchool.SUPS.WebApp.MainForm" %>

<asp:Content ID="Dislocation" ContentPlaceHolderID="Main" runat="Server">

    <asp:GridView
        ID="GridView1"
        runat="server"
        AllowPaging="True"
        AutoGenerateColumns="False"
        GridLines="Horizontal"
        CssClass="grid"
        CellPadding="4"
        PageSize="5"

        DataSourceID="CarObjectDataSource">

        <Columns>
            <asp:BoundField DataField="CarNumber" HeaderText="Номер вагона" />
            <asp:BoundField DataField="CargoWeight" HeaderText="Вес груза" />
            <asp:BoundField DataField="DestinationStation" HeaderText="Станция назначения" />
            <asp:BoundField DataField="CargoCode" HeaderText="Код груза" />
            <asp:BoundField DataField="ConsigneeCode" HeaderText="Код получателя" />
            <asp:BoundField DataField="CarParkType" HeaderText="Тип парка" />
            <asp:BoundField DataField="DepartureStation" HeaderText="Станция начала рейса" />
            <asp:BoundField DataField="OperationCode" HeaderText="Код операции" />
            <asp:BoundField DataField="StringOperationTime" HeaderText="Время операции" />
            <asp:BoundField DataField="StationOfOperation" HeaderText="Станция операции" />
            <asp:BoundField DataField="DeliveryRoad" HeaderText="Дорога сдачи" />
            <asp:BoundField DataField="ReceipRoad" HeaderText="Дорога приема" />
            <asp:BoundField DataField="TrainIndex" HeaderText="Индекс поезда" />
            <asp:BoundField DataField="TrainNumber" HeaderText="Номер поезда" />
        </Columns>

        <HeaderStyle CssClass="grid-header" />
        <RowStyle CssClass="grid-row" />
    </asp:GridView>

    <asp:ObjectDataSource
        ID="CarObjectDataSource"
        runat="server"
        TypeName="DigDes.DSchool.SUPS.DataAccess.Database.WebFormDBLoader"
        SelectMethod="GetAllCarsInfo"></asp:ObjectDataSource>


    <asp:SqlDataSource
        ID="SqlDataSource"
        runat="server"
        ConnectionString="<%$ ConnectionStrings:SUPSDB %>"
        ProviderName="System.Data.SqlClient"
        SelectCommand="select carNumber, cargoWeight,S1.Name as Station1,Cargo.Name as cargoName,consigneeCode,carParkType,S2.Name as Station2,CarOperation.Name as operationName,operationTime,S3.Name as Station3,R1.Name as Road1,R2.Name as Road2,trainIndex,trainNumber from SomeTable inner join Station as S1 on S1.Station_ID = destinationStation inner join Cargo on Cargo.Cargo_ID = cargoCode inner join Station as S2 on S2.Code = departureStation inner join CarOperation on CarOperation.Code = operationCode inner join Station as S3 on S3.Code = stationOfOperation inner join Road as R1 on R1.Code = deliveryRoad inner join Road as R2 on R2.Code = receipRoad"></asp:SqlDataSource>



</asp:Content>


